{extend name="Public/base"/}
{block name="body"}
<div class="main-box clearfix">
	<header class="main-box-header clearfix">
		<div class="pull-left">
			<h2>插件列表</h2>
		</div>
		<div class="pull-right">
			<a href="{:U('Addons/create')}" class="btn btn-primary pull-right">
				新增
			</a>
		</div>
	</header>
	<div class="tabs-wrapper profile-tabs">
		<div class="tab-content">
			<div class="tab-pane fade in active">
				<div class="table-responsive clearfix">
					<table class="table table-striped table-hover">
						<thead>
							<tr>
								<th>ID</th>
								<th>名称</th>
								<th>标识</th>
								<th>描述</th>
								<th>状态</th>
								<th>作者</th>
								<th>版本</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							{volist name="data" id="item"}
							<tr>
								<td>{$item['id']|default='0'}</td>
								<td>{$item['title']}</td>
								<td>{$item['name']}</td>
								<td>{$item['description']}</td>
								<td>
									{if condition="$item['status']"}
									<label class="label label-danger">{$item['status_txt']}</label>
									{else/}
									<label class="label label-default">{$item['status_txt']}</label>
									{/if}
								</td>
								<td>{$item['author']}</td>
								<td>{$item['version']}</td>
								<td>
									<a href="{:U('Addons/config',array('id'=>$item['id']))}">设置</a>
								{if condition="$item['uninstall'] eq 0"}
									<a href="{:U('Addons/uninstall',array('id'=>$item['id']))}" class="ajax-get">卸载</a>
									{if condition="$item['status'] eq 1"}
										<a href="{:U('Addons/disable',array('id'=>$item['id']))}" class="ajax-get">禁用</a>
									{else/}
										<a href="{:U('Addons/enable',array('id'=>$item['id']))}" class="ajax-get">启用</a>
									{/if}
								{else/}
									<a href="{:U('Addons/install',array('addon_name'=>$item['name']))}" class="ajax-get">安装</a>		
								{/if}
								</td>
							</tr>
							{/volist}
						</tbody>
					</table>
				</div>
			</div>
			<!-- 分页 -->
			{$_page}
			<!-- 分页 -->
		</div>
	</div>
</div>
{/block}